const express = require('express')
const app = express()
const login = require('./routes/login')
const navigation = require('./routes/navigation')
const user = require('./routes/userinfo')
const artical = require('./routes/artical')
const users = require('./routes/users')

// 导入 cors 模块，解决跨域问题
const cors = require('cors')
app.use(cors())
app.use(express.urlencoded({ extended: false }))
app.use(express.json())

app.use(login)
app.use(navigation)
app.use(user)
app.use(artical)
app.use(users)

app.listen(3000, () => {
  console.log('Server is running......')
})
